// TOWN DIALOGUE SCRIPT
//    Town 131: Kuper

begintalkscript;

variables;

short i,j,k,r1,choice;

// Mother Melamed

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 1;
	question = "Mother Melamed";
	text1 = "You meet a priestess of the Anama church. She is friendly and willing to take a break from her work to speak with you. _I am Mother Melamed. How may I help you?_";
	text5 = "Though she has much to do to look after this colony, Mother Melamed deems you worth of some of her limited time for conversation.";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_Is this your temple?_";
	text1 = "She smiles. _It belongs to the town. I merely look after it. I just sort of guide things here. We haven't had as much trouble from the roaches as other towns, so we just try to keep things safe and simple._";

begintalknode;
	state = 2;
	nextstate = -1;
	question = "_Why have the roaches stayed away from Kuper?_";
	text1 = "_I'm not sure why we've been invaded by fewer roaches than the other towns._ She smiles, dimples showing. _Just blessed, I guess._";

begintalknode;
	state = 2;
	nextstate = 4;
	question = "_How do you decide how to guide this towns' inhabitants?_";
	text1 = "She pats the altar. _It's not difficult to figure out the path to take, with the Anama faith to help light the way._";
	text2 = "_Of course, it would be easier with help._";

begintalknode;
	state = 4;
	nextstate = 5;
	question = "_Tell me about the Anama faith._";
	text1 = "_This town, like most towns on this island, is shepherded by an Anama priest. It's a beautiful religion. Would you like to hear some of my interpretations of its philosophy?_";
	text3 = "_Much the same way it helps you, I am sure._ She must have noticed your rings. _It focuses the mind and brings safety and happiness, through the resistance to dark powers._";
	code =
		if (has_spec_item(40) == 0)
			remove_string(3);
			else remove_string(1);
	break;

begintalknode;
	state = 5;
	nextstate = -1;
	condition = has_spec_item(40) <= 0;
	question = "_All right. I'll listen to some Anama philosophy._";
	code =
		run_hardcode(127);
	break;

begintalknode;
	state = 1;
	nextstate = 3;
	question = "_How are things going in Kuper?_";
	text1 = "_It is difficult for us. Things are never simple, of course. There is Kneece across the way, making everyone nervous._";
	text2 = "She looks at you meaningfully. _Also, some of our guards have heard there are Avernites around, and they are very jumpy._";

begintalknode;
	state = 3;
	nextstate = -1;
	question = "_What about Kneece makes you nervous?_";
	text1 = "_Olga runs a ferry across to that monster-infested ruin. Heavens only know why people go, but they do. You can find her by the docks._";

begintalknode;
	state = 3;
	nextstate = 7;
	question = "_Why are the guards worried about Avernites?_";
	text1 = "_Some of them served in the war with Avernum, and the wound runs deep. I'd avoid them, if I were you._";

begintalknode;
	state = 7;
	nextstate = -1;
	question = "_Uhhh ... why? I'm not from Avernum._";
	text1 = "She smiles. _Sure you aren't, dears. Sure you aren't._";

begintalknode;
	state = 1;
	nextstate = -1;
	question = "_May I have some healing or magical training?_";
	text1 = "_Oh, I am sorry. I am a priestess, but I am still unskilled in certain skills of the order. To learn magic or receive treatment, your safest course is to travel to Shayder._";

begintalknode;
	state = 4;
	nextstate = -1;
	condition = gf(131,11) <= 1;
	question = "_You need help?_";
	text1 = "_I am afraid so. I was once aided by a man named Mundt. Nervous fellow, but a good assistant. Then, one day, I woke up and he was gone. No idea what happened to him. I wish I knew... his disappearance worries me._";
	text2 = "You ask where Mundt might have gone. _Hmmm. Now that I think about it, he did mention once that he wanted to travel northeast. I wonder if he fled the isle._";
	action = SET_SDF 131 11 1;
	code =
		toggle_quest(41,1);
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(131,11) == 1 && gf(12,12) >= 1;
	question = "_I found Mundt. He lives in Lorelei now. He has no intention of coming back._";
	code =
		run_hardcode(25);
	break;

// Zog

begintalknode;
	tag = 60;
	state = -1;
	nextstate = 29;
	question = "Zog";
	text1 = "You meet an Empire soldier, keeping watch on this corner of town. He has a nasty scar running down the side of his face. He fingers it absent-mindedly as he watches you. _I'm Captain Zog._ His voice drips with contempt.";
	text5 = "Captain Zog continues to stare at you. He runs his finger slowly up and down his scar. It's unnerving.";
	action = INTRO;

begintalknode;
	state = 29;
	nextstate = 30;
	question = "_Are you in charge of the guards in Kuper?_";
	text1 = "_Oh, don't act so clever!_ he spits. _You think you're so smart wandering around like that! Well, everyone knows about you!_";
	text3 = "_Oh, don't act so clever!_ he spits. _You think you're so smart wandering around like that! Well, everyone knows about you, and those Anama rings won't protect you!_";
	code =
		if (has_spec_item(40) == 0)
			remove_string(3);
			else remove_string(1);
	break;

begintalknode;
	state = 30;
	nextstate = 32;
	question = "_I never claimed to be clever._";
	text1 = "_You Avernites think you're all so smart! Well, keep wandering around up here, and we'll show you how clever we can be!_ He spits at your feet, for emphasis.";

begintalknode;
	state = 30;
	nextstate = 31;
	question = "_What do you think of me?_";
	text1 = "_Everyone acts how it's so great you're around. You guys flouted the Empire, so we can too! Well, they don't know! They didn't get wounded in that pit!_ He points at his scar.";

begintalknode;
	state = 31;
	nextstate = -1;
	question = "_How did you get that scar?_";
	text1 = "His voice becomes a hiss. _I lost friends to all of you. One of your spells scarred me for life. There'll never be peace between the Empire and Avernum. As long as I'm around, there'll always be a little bit of war._ He turns away.";
	action = END_TALK;

begintalknode;
	state = 32;
	nextstate = -1;
	question = "_Well, why aren't you doing anything about us? You a coward?_";
	text1 = "The captain takes a moment to try to keep control of his rage. He fails.";
	action = END_TALK;
	code =
		set_attitude(13100,10);
	break;

begintalknode;
	state = 32;
	nextstate = -1;
	question = "_Well then, I'll just be going. Sorry to trouble you._";
	text1 = "He watches you as you back away, slowly running his thumb from one end of his scar to the other, and back again.";
	action = END_TALK;

// Bagzath

begintalknode;
	tag = 80;
	state = -1;
	nextstate = 57;
	question = "Bagzath";
	text1 = "You meet an Empire soldier, drinking and watching the sea. He regards you with naked, barely controlled loathing. _I am Bagzath, worms._ Worm is the term of contempt surface folk use for Avernites. Fighting words.";
	text5 = "Bagzath regards you with naked, barely controlled loathing. _What do you want, worm?_ He's not entirely sober.";
	action = INTRO;

begintalknode;
	state = 57;
	nextstate = 58;
	question = "_Don't call me 'worm'._";
	text1 = "He seems barely able to restrain himself. _I found a way down there. I swore to slay Avernites wherever I can. Back away, or I will destroy you._ He fingers the pommel of his sword, hoping you'll give him an excuse to attack.";

begintalknode;
	state = 58;
	nextstate = -1;
	question = "_You just going to stare at me, coward?_";
	text1 = "He can restrain himself no longer. With a long, pent-up howl of impotent fury, he draws his blade and attacks you.";
	action = END_TALK;
	code =
		set_attitude(13107,10);
	break;

begintalknode;
	state = 57;
	nextstate = 58;
	question = "_So. How do you feel about Avernites?_";
	text1 = "_An Avernite is the lowest form of life. We showed you far more mercy than you could ever deserve. I was down there with Captain Zog. We lost good people. Now, I warn you. Back away, or I will slay you._ He means it.";

begintalknode;
	state = 58;
	nextstate = -1;
	question = "Back away quietly.";
	text1 = "He spits at you and start laughing. It is not a healthy sound. His time in Avernum left him deeply messed up. Fortunately, he lets you go.";
	action = END_TALK;

// Olga

begintalknode;
	tag = 100;
	state = -1;
	nextstate = 85;
	question = "Olga";
	text1 = "A stocky woman stands by the docks. She looks you over, pleased to meet a potential customer. _I am Olga._";
	text5 = "Olga watches you eagerly, hoping to sell some ferry tickets.";
	action = INTRO;

begintalknode;
	state = 85;
	nextstate = 86;
	question = "_What's up?_";
	text1 = "_I run a ferry over to Kneece. The tickets are only thirty coins._ That's quite a high price. _Expensive, I know, but the journey is tricky._";
	
begintalknode;
	state = 86;
	nextstate = -1;
	question = "_Is that all you do?_";
	text1 = "_I fish too, but people seem to like to go to Kneece occasionally. Adventurers. Anama. I don't know why._";

begintalknode;
	state = 86;
	nextstate = -1;
	question = "_What do you know of Kneece?_";
	text1 = "_Kneece is an old ruined town, surrounded by jagged rocks. I don't know if anyone lives there or what. All I know is that people pay enough to go over that just selling a few rides there makes some good money!_";
	text2 = "She leans close. _One thing I do know. There's a big dark tower there. When I get close to the shore, my hair stands on end. It's magic, I'll bet!_";
	
begintalknode;
	state = 86;
	nextstate = -1;
	condition = coins_amount() >= 30;
	question = "_Ok. I'll take a ticket._ Pay 30 coins.";
	text1 = "She takes your coins and gives you a ticket. _Get in the boat at the end of the dock and I'll take you over._";
	text5 = "You have already bought this.";
	action = END_TALK;
	code =
		if (gf(131,8) == 0) {
			sf(131,8,1);
			rs(5);
			change_coins(-30);
			}
			else rs(1);
	break;

begintalknode;
	state = 86;
	nextstate = -1;
	question = "_I don't need a ticket._";
	text1 = "_Oh._";
	action = END_TALK;


